/*
 * XML Type:  UCMDiagram
 * Namespace: http:///org/isistan/flabot/edit/ucmmodel.ecore
 * Java type: org.isistan.flabot.edit.ucmmodelEcore.UCMDiagram
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.edit.ucmmodelEcore.impl;
/**
 * An XML UCMDiagram(@http:///org/isistan/flabot/edit/ucmmodel.ecore).
 *
 * This is a complex type.
 */
public class UCMDiagramImpl extends org.isistan.flabot.edit.editormodelEcore.impl.DiagramImpl implements org.isistan.flabot.edit.ucmmodelEcore.UCMDiagram
{
    private static final long serialVersionUID = 1L;
    
    public UCMDiagramImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName MAP$0 = 
        new javax.xml.namespace.QName("", "map");
    private static final javax.xml.namespace.QName MAP2$2 = 
        new javax.xml.namespace.QName("", "map");
    
    
    /**
     * Gets array of all "map" elements
     */
    public org.isistan.flabot.coremodelEcore.UseCaseMap[] getMapArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(MAP2$2, targetList);
            org.isistan.flabot.coremodelEcore.UseCaseMap[] result = new org.isistan.flabot.coremodelEcore.UseCaseMap[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "map" element
     */
    public org.isistan.flabot.coremodelEcore.UseCaseMap getMapArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.UseCaseMap target = null;
            target = (org.isistan.flabot.coremodelEcore.UseCaseMap)get_store().find_element_user(MAP2$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "map" element
     */
    public int sizeOfMapArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAP2$2);
        }
    }
    
    /**
     * Sets array of all "map" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setMapArray(org.isistan.flabot.coremodelEcore.UseCaseMap[] mapArray)
    {
        check_orphaned();
        arraySetterHelper(mapArray, MAP2$2);
    }
    
    /**
     * Sets ith "map" element
     */
    public void setMapArray(int i, org.isistan.flabot.coremodelEcore.UseCaseMap map)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.UseCaseMap target = null;
            target = (org.isistan.flabot.coremodelEcore.UseCaseMap)get_store().find_element_user(MAP2$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(map);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "map" element
     */
    public org.isistan.flabot.coremodelEcore.UseCaseMap insertNewMap(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.UseCaseMap target = null;
            target = (org.isistan.flabot.coremodelEcore.UseCaseMap)get_store().insert_element_user(MAP2$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "map" element
     */
    public org.isistan.flabot.coremodelEcore.UseCaseMap addNewMap()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.UseCaseMap target = null;
            target = (org.isistan.flabot.coremodelEcore.UseCaseMap)get_store().add_element_user(MAP2$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "map" element
     */
    public void removeMap(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAP2$2, i);
        }
    }
    
    /**
     * Gets the "map" attribute
     */
    public java.lang.String getMap2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MAP2$2);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "map" attribute
     */
    public org.apache.xmlbeans.XmlString xgetMap2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(MAP2$2);
            return target;
        }
    }
    
    /**
     * True if has "map" attribute
     */
    public boolean isSetMap2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(MAP2$2) != null;
        }
    }
    
    /**
     * Sets the "map" attribute
     */
    public void setMap2(java.lang.String map2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MAP2$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(MAP2$2);
            }
            target.setStringValue(map2);
        }
    }
    
    /**
     * Sets (as xml) the "map" attribute
     */
    public void xsetMap2(org.apache.xmlbeans.XmlString map2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(MAP2$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(MAP2$2);
            }
            target.set(map2);
        }
    }
    
    /**
     * Unsets the "map" attribute
     */
    public void unsetMap2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(MAP2$2);
        }
    }
}
